import BattleManager from "./battle/BattleManager"

export default class Root{
    private static _i
    static get I():Root{
        if(!Root._i){
            Root._i=new Root()
        }
        return Root._i
    }
    
    init(){
        

        let assets=[
            'res/atlas/comp.atlas',
            'res/atlas/monsters.atlas',
            'prefab/actorV.prefab',
        ]
        Laya.loader.load(assets,Laya.Handler.create(this,this.onLoaded))
    }

    private onLoaded(){
        BattleManager.I.init()
    }

    private _gId=0 //gameObject id 
    getGId():number{
        return ++this._gId
    }
}